#pragma once

#include <action\Action.h>
#include <action\BasicMenuAction.h>
#include "..\GameCore.h"

// ------------------------------------------------
//
// ------------------------------------------------
class UpdateBackgroundAction : public ds:: Action {

public:
	UpdateBackgroundAction(GameCore* core) : Action("UpdateBackground") , m_Core(core) {
		m_ShaderHandle = gEngine->getResourceManager().findByName("Background",ds::RS_SHADER);	
	}
	virtual ~UpdateBackgroundAction(void) {}
	void start() {
		m_Timer = 0.0f;
		setActive(true);
	}
	void stop() {
		setActive(false);
	}
	void update(float elapsed);
private:
	ds::ResourceHandle m_ShaderHandle;
	float m_Timer;	
	GameCore* m_Core;
};

// ------------------------------------------------
//
// ------------------------------------------------
class MouseAction : public ds:: Action, public ds::MouseController {

public:
	MouseAction(GameCore* core) : Action("HandleMouse") , m_Core(core) {	
		gEngine->addMouseController(this);
		stop();
	}
	virtual ~MouseAction(void) {}
	void OnButtonDown( int button ) {}
	void OnButtonUp( int button );
	void start() {
		setActive(true);
	}
	void stop() {
		setActive(false);
	}
	void update(float elapsed) {}
private:	
	GameCore* m_Core;
};

// ------------------------------------------------
//
// ------------------------------------------------
class ShowGridAction : public ds:: Action {

public:
	ShowGridAction(GameCore* core) : Action("ShowGrid") , m_Core(core) {
		stop();
	}
	virtual ~ShowGridAction(void) {}
	void start();
	void stop();
	void update(float elapsed) {
		if ( isActive() ) {
			m_Core->gutter().update(elapsed);
		}
	}
private:	
	GameCore* m_Core;
};

